home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2006 May / PCWMAY06.iso / Software / Freeware / First Page 2006 3.00 / fp2006-final-3.00-setup.exe / {app} / Iscripts / Date & Calendars / auto-exp.izs < prev    next >
Text File  |  2005-09-27  |  3KB  |  119 lines

  1. <!NOWIZARD>
  2.  
  3. <!TITLE>Auto Expire 
  4. <!/TITLE>
  5.  
  6. <!DESCRIPTION>Content will only be displayed between the 'Go Live' date and the 'Expires' date. Great for promotions that start on a certain date, and end on another date. Works in MSIE only<!/DESCRIPTION> 
  7.  
  8. <!CATEGORY>calenders<!/CATEGORY>
  9.  
  10. <!SCRIPT>
  11. <!-- START OF SCRIPT -->
  12.  
  13. <!-- HOW TO INSTALL AUTO EXPIRE:
  14.  
  15.   1.  Copy the coding into the BODY of your HTML document  -->
  16.  
  17. <!-- STEP ONE: Paste this code into the BODY of your HTML document  -->
  18.  
  19. <BODY>
  20.  
  21. <SCRIPT LANGUAGE="JavaScript">
  22.  
  23. <!-- Don Demrow -->
  24.  
  25. <!-- Begin
  26. // Set the dates below
  27. var goLiveDate = "20030613";
  28. var expireDate = "20101015";
  29.  
  30. var expireYear = expireDate.substring(0,4)
  31. var expireMonth = expireDate.slice(4,-2)
  32. var expireDay = expireDate.slice(6)
  33. var liveYear = goLiveDate.substring(0,4)
  34. var liveMonth = goLiveDate.slice(4,-2)
  35. var liveDay = goLiveDate.slice(6)
  36. var nowDate = new Date();
  37. var day = nowDate.getUTCDate();
  38. var month = nowDate.getUTCMonth();
  39. var month1 = month + 1;
  40.   if (month1 < 10)
  41.   {
  42.   month1 = "0" + month1;
  43.   }
  44.   if (day < 10)
  45.   {
  46.   day = "0" + day;
  47.   }
  48. var year = nowDate.getYear();
  49. var GMTdate = year + "" + month1 + "" + day
  50. if ((GMTdate < expireDate) && (GMTdate >= goLiveDate))
  51. {
  52.  
  53. // Insert the text you want displayed below
  54. document.write("<div align='center'><b>This content appeared on " + liveMonth + "/" + liveDay + "/" + liveYear + "<br>and will disappear on " + expireMonth + "/" + expireDay + "/" + expireYear +".</b></div>")
  55.  
  56. }
  57. //  End -->
  58. </script>
  59.  
  60. <!-- END OF SCRIPT -->
  61. <!/SCRIPT>
  62.  
  63. <!PREVIEW>
  64. <!-- START OF SCRIPT -->
  65.  
  66.  
  67. <!-- HOW TO INSTALL AUTO EXPIRE:
  68.  
  69.   1.  Copy the coding into the BODY of your HTML document  -->
  70.  
  71. <!-- STEP ONE: Paste this code into the BODY of your HTML document  -->
  72.  
  73. <BODY>
  74.  
  75. <SCRIPT LANGUAGE="JavaScript">
  76.  
  77. <!-- Don Demrow -->
  78.  
  79. <!-- Begin
  80. // Set the dates below
  81. var goLiveDate = "20030613";
  82. var expireDate = "20101015";
  83.  
  84. var expireYear = expireDate.substring(0,4)
  85. var expireMonth = expireDate.slice(4,-2)
  86. var expireDay = expireDate.slice(6)
  87. var liveYear = goLiveDate.substring(0,4)
  88. var liveMonth = goLiveDate.slice(4,-2)
  89. var liveDay = goLiveDate.slice(6)
  90. var nowDate = new Date();
  91. var day = nowDate.getUTCDate();
  92. var month = nowDate.getUTCMonth();
  93. var month1 = month + 1;
  94.   if (month1 < 10)
  95.   {
  96.   month1 = "0" + month1;
  97.   }
  98.   if (day < 10)
  99.   {
  100.   day = "0" + day;
  101.   }
  102. var year = nowDate.getYear();
  103. var GMTdate = year + "" + month1 + "" + day
  104. if ((GMTdate < expireDate) && (GMTdate >= goLiveDate))
  105. {
  106.  
  107. // Insert the text you want displayed below
  108. document.write("<div align='center'><b>This content appeared on " + liveMonth + "/" + liveDay + "/" + liveYear + "<br>and will disappear on " + expireMonth + "/" + expireDay + "/" + expireYear +".</b></div>")
  109.  
  110. }
  111. //  End -->
  112. </script>
  113.  
  114.  
  115.  
  116. <!-- END OF SCRIPT -->
  117. <!/PREVIEW>
  118.  
  119. <!RELATED>NONE<!/RELATED>